from pyecharts.charts import Line
from pyecharts.options import InitOpts,TitleOpts,LegendOpts,ToolboxOpts,VisualMapOpts,AxisOpts
import   pyecharts.options   as   opts

line3=Line()

line3=Line(init_opts=InitOpts(width="900px",height="600px",page_title="各地区水质污染评价",theme="white"))
line3.add_xaxis(
    ["P1","P2","P3","P4","P5","P6"])
line3.add_yaxis("CODmn污染物排放量",[0.0422,0.0630,0.1501,0.0691,0.0998,0.0682],linestyle_opts=opts.LineStyleOpts(color="black",width=4),itemstyle_opts=opts.ItemStyleOpts(border_width=3,border_color="green"))
line3.add_yaxis("NH3-N污染物排放量",[0.0484,0.0732,0.1965,0.0833,0.1155,0.0394],symbol="arrow",is_symbol_show="True",linestyle_opts=opts.LineStyleOpts(color="red",width=4),itemstyle_opts=opts.ItemStyleOpts(border_width=3,border_color="yellow"))

line3.set_global_opts(
    title_opts=TitleOpts("各段落水质污染", pos_left="end", pos_top="1%"),
    legend_opts=LegendOpts(is_show=True),
    toolbox_opts=ToolboxOpts(is_show=True),
    visualmap_opts=VisualMapOpts(is_show=True),
    xaxis_opts=AxisOpts(type_='category',name='流域段',name_location='end',name_gap=20,axislabel_opts={"interval":"0"})
)

line3.render()